package dev.bong.vo;

import dev.bong.pojo.entity.User;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: bong~
 * @description: TODO
 * @date: 2024/4/11 20:53
 * @version: 1.0
 */

@Data
@NoArgsConstructor
@ApiModel("管理员信息")
public class AdminVo{

    private String userAccount;
    private String userPassword;
    private String userName;

    public static User toUser(AdminVo vo){
        User user=new User();
        user.setUserName(vo.getUserName());
        user.setUserPassword(vo.getUserPassword());
        user.setUserAccount(vo.getUserAccount());
        return user;
    }

    public static AdminVo toAdminVo(User user){
        AdminVo adminVo=new AdminVo();
        adminVo.setUserAccount(user.getUserAccount());
        adminVo.setUserPassword(user.getUserPassword());
        adminVo.setUserName(user.getUserName());

        return adminVo;
    }
}



